package main

import (
	"fmt"
	"gogogo/web/service"
	"net"
	"net/http"
	"net/rpc"
	"time"
)

func main() {
	calc := new(service.Args)
	rpc.Register(calc)
	rpc.HandleHTTP()
	listen, err := net.Listen("tcp", "localhost:1234")
	if err != nil {
		fmt.Println("start server fail.", err.Error())
		return
	}
	go http.Serve(listen, nil)
	time.Sleep(10 * time.Second)
}
